Welcome Guest, Not a member yet? Register   Sign In
session w/ user roles
#1

Databases are not my thing... I mean I just don't get them. That being said, I have used codeigniter a while ago w/ grocery crud to try to learn this stuff and made something that worked but didn't touch it for a while and forgot everything. What I am trying to build is a log in with sessions where I can assign user rights based on roles. Do any of you know of any tutorials, pluggins, scripts or anything that would help me create this environment? I have found examples of sessions but roles are evading me.
Reply
#2

(This post was last modified: 10-28-2015, 11:47 AM by ignitedcms.)

The basic data structure for permissions is

Code:
#
# TABLE STRUCTURE FOR: permission_groups
#

DROP TABLE IF EXISTS `permission_groups`;

CREATE TABLE `permission_groups` (
  `groupID` int(11) NOT NULL AUTO_INCREMENT,
  `groupName` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`groupID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;



#
# TABLE STRUCTURE FOR: permission_map
#

DROP TABLE IF EXISTS `permission_map`;

CREATE TABLE `permission_map` (
  `groupID` int(11) NOT NULL DEFAULT '0',
  `permissionID` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`groupID`,`permissionID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



#
# TABLE STRUCTURE FOR: permissions
#

DROP TABLE IF EXISTS `permissions`;

CREATE TABLE `permissions` (
  `permissionID` int(11) NOT NULL AUTO_INCREMENT,
  `permission` varchar(200) DEFAULT NULL,
  `order_position` int(11) NOT NULL,
  PRIMARY KEY (`permissionID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
Practical guide to IgnitedCMS - Book coming soon
Reply
#3

ion auth: https://github.com/benedmunds/CodeIgniter-Ion-Auth
docs: http://benedmunds.com/ion_auth/
author ben edmunds is on the codeigniter council
Reply
#4

ha thats funny -- this tutorial for ion auth was just posted by Avenirer a few hours ago, looks pretty cool

http://avenir.ro/authentication-system-w...h-and-ci3/
Reply
#5

Thanks for that. I will give it a shot when I get home.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB