美文网首页
学习javaweb-权限管理

学习javaweb-权限管理

作者: goldgreat | 来源:发表于2017-09-26 15:42 被阅读0次

    权限管理分析

    我们做的权限管理主要是用户有什么菜单,菜单对用页面地址
    用户对应多个角色,角色对应多个菜单这样的关系
    比如用户有超级管理员和经理两个角色,那么用户就会拥有这两个角色下面的所有菜单 新建表如下

    DROP TABLE IF EXISTS `category`;
    
    CREATE TABLE `category` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `categoryname` varchar(255) DEFAULT NULL,
      `siteurl` varchar(255) DEFAULT NULL,
      `sortno` int(2) DEFAULT NULL,
      `icon` varchar(255) DEFAULT NULL,
      `createtime` datetime DEFAULT NULL,
      `updatetime` datetime DEFAULT NULL,
      `isdelete` int(2) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    /*Data for the table `category` */
    
    /*Table structure for table `role` */
    
    DROP TABLE IF EXISTS `role`;
    
    CREATE TABLE `role` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `rolename` varchar(255) DEFAULT NULL,
      `createtime` datetime DEFAULT NULL,
      `updatetime` datetime DEFAULT NULL,
      `isdelete` int(2) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    /*Data for the table `role` */
    
    /*Table structure for table `rolecategory` */
    
    DROP TABLE IF EXISTS `rolecategory`;
    
    CREATE TABLE `rolecategory` (
      `int` int(11) NOT NULL AUTO_INCREMENT,
      `roleid` int(11) DEFAULT NULL,
      `categoryid` int(11) DEFAULT NULL,
      `createtime` datetime DEFAULT NULL,
      `updatetime` datetime DEFAULT NULL,
      `isdelete` int(2) DEFAULT NULL,
      PRIMARY KEY (`int`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    /*Data for the table `rolecategory` */
    
    /*Table structure for table `user` */
    
    DROP TABLE IF EXISTS `user`;
    
    CREATE TABLE `user` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `username` varchar(255) DEFAULT NULL,
      `password` varchar(255) DEFAULT NULL,
      `umobile` varchar(11) DEFAULT NULL,
      `sex` int(2) DEFAULT NULL,
      `createTime` datetime DEFAULT NULL,
      `updateTime` datetime DEFAULT NULL,
      `isdelete` int(11) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
    
    
    /*Table structure for table `userrole` */
    
    DROP TABLE IF EXISTS `userrole`;
    
    CREATE TABLE `userrole` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `uid` int(11) DEFAULT NULL,
      `roleid` int(11) DEFAULT NULL,
      `createtime` datetime DEFAULT NULL,
      `updatetime` datetime DEFAULT NULL,
      `isdelete` int(2) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    

    做表的增删改查

    相关文章

      网友评论

          本文标题:学习javaweb-权限管理

          本文链接:https://www.haomeiwen.com/subject/sbisextx.html