|
I've been working on the PostgreSQL code and I've recently noticed some
weirdness with permissions as well. I've noticed a little discrepancy
in the dmPolicyGroup table between MySQL and PostgreSQL installs: This is from MySQL: PolicyGroupId PolicyGroupName 1 SysAdmin 2 SiteAdmin 3 Member 5 Contributors 6 Publishers 7 Anonymous and from PostgreSQL: policygroupid policygroupname 1 SysAdmin 2 SiteAdmin 3 Member 4 Contributors 5 Publishers 6 Anonymous notice how in MySQL there is no id of 4? That little shift messes (at least) with the policy group mappings, which I believe in the installer maps using the ids. I've traced it down to the farcry_core/packages/security/authorization.cfc file where you can create a policy group (createPolicyGroup). Both Oracle and PostgreSQL use sequences for their auto incrementing columns. The code for both Oracle and PostgreSQL would always use the next sequence number even if a policyGroupId was passed to the method. The result is the 1-6 that you see without the missing 4. In the farcry_core/admin/install/dmSec_files/policyGroups.wddx, which this data is based on, you'll notice the missing 4. Here is the new code for Oracle and PostgreSQL for the authorization.cfc file starting at line 318. Please note I don't have access to Oracle so I can't verify if it works. You could either reinstall or just update the policyGroupId values in the table. case "ora":
{
sql = "
INSERT INTO #application.dbowner##stPolicyStore.PolicyGroupTable# (policyGroupName,policyGroupNotes,policyGroupID)
VALUES
('#arguments.PolicyGroupName#' ,'#arguments.PolicyGroupNotes#'";
if (isDefined("arguments.policyGroupId")) {
sql = sql & ",#arguments.policyGroupId#";
} else {
sql = sql & ",DMPOLICYGROUP_SEQ.nextval";
}
sql = sql & ")";;
break;
}
case "postgresql":
{
sql = "
INSERT INTO #application.dbowner##stPolicyStore.PolicyGroupTable# ( policyGroupName,policyGroupNotes ";
if (isDefined("arguments.policyGroupId"))
sql = sql & ",policyGroupId";
sql = sql & ")
VALUES
('#arguments.PolicyGroupName#' ,'#arguments.PolicyGroupNotes#'";
if (isDefined("arguments.policyGroupId"))
sql = sql & ",#arguments.policyGroupId#";
sql = sql & ")";
break;
}
--Kyle Kyle
Singer Geoff Bowers wrote: If this is the case it should be relatively easy to fix. You should be able to export and import policies from the security area. Would be good to see if this is common across all db type installs (and then when the error was introduced :) --- |
- [farcry-dev] RE: Permissions and policy groups Alexander Park
- [farcry-dev] RE: Permissions and policy groups Nathan Mische
- [farcry-dev] RE: Permissions and policy groups Nathan Mische
- [farcry-dev] Re: Permissions and policy groups Geoff Bowers
- [farcry-dev] Re: Permissions and policy groups Kyle Singer
- [farcry-dev] Re: Permissions and policy groups Nathan Mische
- [farcry-dev] Re: Permissions and policy groups Kyle Singer
- [farcry-dev] Re: Permissions and policy groups Nathan Mische
- [farcry-dev] Re: Permissions and policy groups Kyle Singer
- [farcry-dev] Re: Permissions and policy groups Nathan Mische
- [farcry-dev] Re: Permissions and policy groups Brendan Sisson
- [farcry-dev] Re: Permissions and policy groups Brendan Sisson
- [farcry-dev] Re: Permissions and policy groups Nathan Mische
