[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5585] trunk



Revision: 5585
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5585&view=rev
Author:   einhverfr
Date:     2013-01-16 06:53:28 +0000 (Wed, 16 Jan 2013)
Log Message:
-----------
Better handling of user roles, user management, and employee management

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/sql/modules/Roles.sql

Modified: trunk/LedgerSMB/Scripts/employee.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee.pm	2013-01-16 06:43:32 UTC (rev 5584)
+++ trunk/LedgerSMB/Scripts/employee.pm	2013-01-16 06:53:28 UTC (rev 5585)
@@ -93,12 +93,12 @@
         );
     }
     # DIVS logic
-    my @DIVS;
-    if ($employee->{entity_id}){
-       @DIVS = qw(employee user wage address contact_info bank_act notes files);
-    } else {
-       @DIVS = qw(employee);
-    }
+    my @DIVS = qw(employee);
+    push @DIVS, 'user' 
+        if $request->is_allowed_role({ allowed_roles => ['users_manage']});
+    push @DIVS, qw(wage address contact_info bank_act notes files)
+        if ($employee->{entity_id});
+
     $request->{target_div} ||= 'employee_div';
 
     my %DIV_LABEL = (

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2013-01-16 06:43:32 UTC (rev 5584)
+++ trunk/sql/modules/Roles.sql	2013-01-16 06:53:28 UTC (rev 5585)
@@ -1396,9 +1396,7 @@
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__users_manage"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__contact_edit",
-"lsmb_<?lsmb dbname ?>__contact_create",
-"lsmb_<?lsmb dbname ?>__employees_manage";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
 GRANT SELECT ON role_view TO "lsmb_<?lsmb dbname ?>__users_manage";
 GRANT EXECUTE ON FUNCTION  admin__add_user_to_role(TEXT, TEXT) 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.