Hi, can someone explain how the resourcetype and accesscontrol works?
i've been trying different combinations to no avail, and the instructions dont really state how they work very well.
i have 2 folders in the baseurl that i want to have different permissions, the user role is the same for both folders.
in folder 1 i want to enable upload, delete etc
in folder 2 i wat to restrict upload, delete etc.
My resources are setup as follows:
folder 1:
$config['ResourceType']['userlib'] = Array(
'name' => 'User Library'
'url' => $baseUrl.$config['userid'].'/library',
'directory' => $baseDir.$config['userid'].'/library',
'maxSize' => "100K",
'allowedExtensions' => 'jpeg,jpg,png',
);
$config['ResourceType']['sharedlib'] = Array(
'name' => 'Shared Library'
'url' => $baseUrl.'/shared',
'directory' => $baseDir.'/shared',
'maxSize' => "100K",
'allowedExtensions' => 'jpeg,jpg,png',
);
my acl i have tried in several combinations, it's currently as follows:
$config['AccessControl'][] = Array(
'role' => '*',
'resourceType' => '*',
'folder' => $config['userid'].'/library',
'folderView' => true,
'folderCreate' => true,
'folderRename' => true,
'folderDelete' => true,
'fileView' => true,
'fileUpload' => true,
'fileRename' => true,
'fileDelete' => true
);
$config['AccessControl'][] = Array(
'role' => '*',
'resourceType' => '*',
'folder' => '/shared',
'folderView' => true,
'folderCreate' => false,
'folderRename' => false,
'folderDelete' => false,
'fileView' => true,
'fileUpload' => false,
'fileRename' => false,
'fileDelete' => false
);
my expectations are that the resource folders will adopt the required permissions above, which is not the case.
Can someone advise where i am going wrong with this please?
many thanks
millzee
i've been trying different combinations to no avail, and the instructions dont really state how they work very well.
i have 2 folders in the baseurl that i want to have different permissions, the user role is the same for both folders.
in folder 1 i want to enable upload, delete etc
in folder 2 i wat to restrict upload, delete etc.
My resources are setup as follows:
folder 1:
$config['ResourceType']['userlib'] = Array(
'name' => 'User Library'
'url' => $baseUrl.$config['userid'].'/library',
'directory' => $baseDir.$config['userid'].'/library',
'maxSize' => "100K",
'allowedExtensions' => 'jpeg,jpg,png',
);
$config['ResourceType']['sharedlib'] = Array(
'name' => 'Shared Library'
'url' => $baseUrl.'/shared',
'directory' => $baseDir.'/shared',
'maxSize' => "100K",
'allowedExtensions' => 'jpeg,jpg,png',
);
my acl i have tried in several combinations, it's currently as follows:
$config['AccessControl'][] = Array(
'role' => '*',
'resourceType' => '*',
'folder' => $config['userid'].'/library',
'folderView' => true,
'folderCreate' => true,
'folderRename' => true,
'folderDelete' => true,
'fileView' => true,
'fileUpload' => true,
'fileRename' => true,
'fileDelete' => true
);
$config['AccessControl'][] = Array(
'role' => '*',
'resourceType' => '*',
'folder' => '/shared',
'folderView' => true,
'folderCreate' => false,
'folderRename' => false,
'folderDelete' => false,
'fileView' => true,
'fileUpload' => false,
'fileRename' => false,
'fileDelete' => false
);
my expectations are that the resource folders will adopt the required permissions above, which is not the case.
Can someone advise where i am going wrong with this please?
many thanks
millzee
Re: resource types and acls
managed to figure this out, i was putting the resource name in the wrong place.
put the name here:$config['AccessControl']['userlib'] = Array(
instead it needed to be:
$config['AccessControl'][] = Array(
'role' => '*',
'resourceType' => 'userlib', <===========================HERE
'folder' => '/',
'folderView' => true,
'folderCreate' => true,
'folderRename' => true,
'folderDelete' => true,
'fileView' => true,
'fileUpload' => true,
'fileRename' => true,
'fileDelete' => true
);