Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #18642 - user/selfedit policy does not work without at least one content/edit and content/create policy #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kernel/classes/ezcontentobject.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4649,7 +4649,7 @@ function canEdit( $originalClassID = false, $parentClassID = false, $returnAcces
$user = eZUser::currentUser();
if ( $user->attribute( 'contentobject_id' ) === $this->attribute( 'id' ) )
{
$access = $user->hasAccessTo( 'user', 'selfedit' );
$access = $user->hasAccessTo( 'content', 'selfedit' );
if ( $access['accessWord'] == 'yes' )
{
$canEdit = 1;
Expand All @@ -4675,7 +4675,7 @@ function canTranslate( )
$user = eZUser::currentUser();
if ( $user->id() == $this->attribute( 'id' ) )
{
$access = $user->hasAccessTo( 'user', 'selfedit' );
$access = $user->hasAccessTo( 'content', 'selfedit' );
if ( $access['accessWord'] == 'yes' )
{
$this->Permissions["can_translate"] = 1;
Expand Down
2 changes: 1 addition & 1 deletion kernel/classes/ezcontentobjecttreenode.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function canEdit( )
$user = eZUser::currentUser();
if ( $user->id() == $this->ContentObject->attribute( 'id' ) )
{
$access = $user->hasAccessTo( 'user', 'selfedit' );
$access = $user->hasAccessTo( 'content', 'selfedit' );
if ( $access['accessWord'] == 'yes' )
{
$this->Permissions["can_edit"] = 1;
Expand Down
3 changes: 2 additions & 1 deletion kernel/content/module.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

$ViewList = array();
$ViewList['edit'] = array(
'functions' => array( 'edit or create' ),
'functions' => array( 'edit or create or selfedit' ),
'default_navigation_part' => 'ezcontentnavigationpart',
'ui_context' => 'edit',
'single_post_actions' => array( 'PreviewButton' => 'Preview',
Expand Down Expand Up @@ -695,5 +695,6 @@
$FunctionList['cleantrash'] = array();
$FunctionList['tipafriend'] = array();
$FunctionList['dashboard'] = array();
$FunctionList['selfedit'] = array();

?>
1 change: 0 additions & 1 deletion kernel/user/module.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,5 @@
$FunctionList['password'] = array();
$FunctionList['preferences'] = array();
$FunctionList['register'] = array();
$FunctionList['selfedit'] = array();

?>
2 changes: 1 addition & 1 deletion settings/menu.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ PolicyList_collaboration[]=collaboration/view
Links[dashboard]=content/dashboard

Links[edit_profile]=user/edit/(action)/edit
PolicyList_edit_profile[]=user/selfedit
PolicyList_edit_profile[]=content/selfedit

Links[my_bookmarks]=content/bookmark
PolicyList_my_bookmarks[]=content/bookmark
Expand Down