@@ -27,12 +27,12 @@ class FieldsControllerGroup extends JControllerForm
2727 protected $ text_prefix = 'COM_FIELDS_GROUP ' ;
2828
2929 /**
30- * The extension for which the group applies.
30+ * The component for which the group applies.
3131 *
3232 * @var string
3333 * @since __DEPLOY_VERSION__
3434 */
35- private $ extension ;
35+ private $ component = '' ;
3636
3737 /**
3838 * Class constructor.
@@ -45,7 +45,12 @@ public function __construct($config = array())
4545 {
4646 parent ::__construct ($ config );
4747
48- $ this ->extension = $ this ->input ->getCmd ('extension ' );
48+ $ parts = FieldsHelper::extract ($ this ->input ->getCmd ('context ' ));
49+
50+ if ($ parts )
51+ {
52+ $ this ->component = $ parts [0 ];
53+ }
4954 }
5055
5156 /**
@@ -81,7 +86,7 @@ public function batch($model = null)
8186 */
8287 protected function allowAdd ($ data = array ())
8388 {
84- return JFactory::getUser ()->authorise ('core.create ' , $ this ->extension );
89+ return JFactory::getUser ()->authorise ('core.create ' , $ this ->component );
8590 }
8691
8792 /**
@@ -100,19 +105,19 @@ protected function allowEdit($data = array(), $key = 'parent_id')
100105 $ user = JFactory::getUser ();
101106
102107 // Check general edit permission first.
103- if ($ user ->authorise ('core.edit ' , $ this ->extension ))
108+ if ($ user ->authorise ('core.edit ' , $ this ->component ))
104109 {
105110 return true ;
106111 }
107112
108113 // Check edit on the record asset (explicit or inherited)
109- if ($ user ->authorise ('core.edit ' , $ this ->extension . '.fieldgroup. ' . $ recordId ))
114+ if ($ user ->authorise ('core.edit ' , $ this ->component . '.fieldgroup. ' . $ recordId ))
110115 {
111116 return true ;
112117 }
113118
114119 // Check edit own on the record asset (explicit or inherited)
115- if ($ user ->authorise ('core.edit.own ' , $ this ->extension . '.fieldgroup. ' . $ recordId ) || $ user ->authorise ('core.edit.own ' , $ this ->extension ))
120+ if ($ user ->authorise ('core.edit.own ' , $ this ->component . '.fieldgroup. ' . $ recordId ) || $ user ->authorise ('core.edit.own ' , $ this ->component ))
116121 {
117122 // Existing record already has an owner, get it
118123 $ record = $ this ->getModel ()->getItem ($ recordId );
0 commit comments