Welcome, Guest
Username: Password: Remember me

TOPIC: Seeking JAccessRule help

Seeking JAccessRule help 3 months 1 week ago #8275

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Hi folks

I'm stuck on some aspects within my project and I would like to get some help.

I need assistance in understanding how to access #__assets.rules, manipulate rules data and store again

I know there is JAccessRule, JAccessRules, and even JAccessWrapper (though nothing seems to use it)

If someone in Perth wants to meet or if anyone wants to Skype etc that would be great, even email is cool.

Willing to pay of course

Heads Up: I am using Seblod, however my questions aren't really Seblod related.
Jon
Last Edit: 2 months 3 weeks ago by sozzled. Reason: In accordance with established practice, topics in the "Jobs" category created more than two weeks ago are archived
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8277

  • tuum
  • tuum's Avatar
  • Offline
  • Moderator
  • Posts: 192
  • Thank you received: 60
Hi Jon,

I can't say that I've ever had the need to access the #__assets table directly. What is it you are trying to achieve?

Here are a couple of links that explain a bit about the purpose of the #__assets table, not sure if they are of any help to you.
www.informit.com/articles/article.aspx?p=1728831&seqNum=9
stackoverflow.com/questions/12877216/joo...assets-table-purpose
docs.joomla.org/Fixing_the_assets_table

regards

Tim
Follow me on twitter twitter.com/bfsurvey
Last Edit: 3 months 1 week ago by tuum.
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8278

  • sozzled
  • sozzled's Avatar
  • Offline
  • Moderator
  • I'm just a user, mate!
  • Posts: 118
  • Thank you received: 21
Hmm ... this doesn't seem to be something that registers much of a blip among the more experienced members of the Joomla community, either (forum.joomla.org/viewtopic.php?f=706&t=952362).
Read my blog and
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8279

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Hi

folks.

It didn't register a blip therefore I am asking if someone will help for cash $$$


Thanks for the links, I understand what #__assets.rules is for, it is to control the actions that user can perform once they have access.

The question is: How can I manipulate that data....

I'm all by my lonesome here in Perth so my best buddies for this are forums and google.

It has got me to a point but I need assistance.

I could explain my logic here but it would probably result in more questions and then more answers and then more questions about the logic, but really I just want to be able to communicate with someone that can help with manipulating #__assets.rules and perhaps correct my logic in the process

Regards

Jon
Last Edit: 3 months 1 week ago by Bucklash.
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8281

  • tuum
  • tuum's Avatar
  • Offline
  • Moderator
  • Posts: 192
  • Thank you received: 60
Hi Jon,
Bucklash wrote:
It didn't register a blip therefore I am asking if someone will help for cash $$$

I'm not surprised, because from what you have said you are trying to alter the assests table directly, which is something no-one does. You seem to be either asking the wrong question, or not being clear on what you are trying to achieve.
Bucklash wrote:
The question is: How can I manipulate that data....

Normally in a third party extension, your access.xml file defines which permissions an extension can have. For example, core.admin, core.manage etc.
Then your config.xml would have a permissions fieldset to display these rules.
You can then use your component options to set which groups have various permissions.

No coding required to access the #__assets table directly, just use the core Joomla functionality which manipulates the records in this table for you.

Now in your extension, you can check against these permissions to see if a user is authorised to perform that action or display that view.
Most extensions will have a getActions function that returns JObject, which you would then use to check the permission, such as
$canDo = JHelperContent::getActions('com_banners', 'category', $this->item->catid);

if ($canDo->get('core.admin')) {
	//user has permission to do this
}

regards

Tim
Follow me on twitter twitter.com/bfsurvey
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8282

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Hi Tim

Thanks for that

I am using Seblod which extends com_content.

I have not created a new component but would like to assign certain actions to certain content types.
(not the way Joomla was designed so maybe it is a sort of hack - but that's where I am)

So,
for content type 'x' assign permissions a,b and c
for content type 'z' assign permissions a,d,e

Thant make sense?

Ps The idea is to not assign the relevant permissions every time you create a new article based on a content type.
It is a little bit more complicated than that but just trying to shed light on what I am trying to do.

PPS: The reason i am not making a component is because I found it too confusing and daunting. In my learning curve I have grabbed on to whatever I thought would help me, hence Seblod seemed (and seems) the way for me. At the time, creating a component and doing funky stuff with that seemed like a can of worms containing an infinite cans of worms.
Maybe different now, but again, that's where I am
Last Edit: 3 months 1 week ago by Bucklash.
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8284

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Hi Tim

NOTE:
Since posting this I now have a deeper appreciation of the difference between JUri::root(); and JPATH_ADMINISTRATOR and JPATH_BASE

Holy smoke, it is exactly this sort of thing that takes me a loooooong time to appreciate
END NOTE

Well, I have digested further what you have written.
Would you be willing to assist me further?

If no, fair enough, but if yes -> :laugh:
To highlight where I m at today
I have created an access.xml file.
Placed it in:
JURI::root().'libraries/teachers-pet/base/access.xml';

I have my permissions in there ie...

<?xml version="1.0" encoding="utf-8" ?>
<access component="teachers_pet">
<section name="permissions">
<action name="core.create" etc....


Doing some tests, trying to see what's what I am trying to pull these permissions:

// TEST 1
// set path
$path = JURI::root().'libraries/teachers-pet/base/access.xml';

// get actions
$actionsFromFile = JAccess::getActionsFromFile($path,"access/section[@name='permissions']/");

// have a look at result
var_dump($actionsFromFile);

// result
bool(false)


// TEST 2
// set path
$path = JURI::root().'administrator/components/com_content/access.xml';

// get actions
$actionsFromFile = JAccess::getActionsFromFile($path,"/access/section[@name='article']/");

// have a look at result
var_dump($actionsFromFile);

// result
bool(false)

Jon
Last Edit: 3 months 1 week ago by Bucklash. Reason: Update
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8285

  • tuum
  • tuum's Avatar
  • Offline
  • Moderator
  • Posts: 192
  • Thank you received: 60
Hi Jon,
This might help
docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_ACL

You may need to open your component options and save before any access rules are created.

regards

Tim

P.S. If you want to learn component development, I know a good book ;)
www.packtpub.com/web-development/learnin...opment-third-edition
Follow me on twitter twitter.com/bfsurvey
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 1 week ago #8286

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Hi Tim

I will splash out on the book :woohoo:

Having a conversation, even as scattered as this has actually helped me a lot.
I now have my actions available, just need to work on assigning the Usergroup ID's as I require them to be....

Many thanks for setting me on the right track

Jon
The administrator has disabled public write access.

Seeking JAccessRule help 3 months 5 days ago #8290

  • Bucklash
  • Bucklash's Avatar
  • Offline
  • Junior Boarder
  • Posts: 39
  • Thank you received: 4
Just an FYI ...
Purchased book. I like it a lot.
Nicely explained as I'm sure many people have told you.

I am generally put off from purchasing Joomla books as they are mostly pretty old by now.
I have a plugin development book which is good but a little confusing too.

There is a confusing bit in your book that I am taking my time to digest, re Legacy.
I keep making myself chuckle at the notion that legacy classes are current and non legacy are legacy.
Or that's how I read it currently.
Maybe that section is more for those that use namespaces - see, not digested it fully yet.

All the best

Jon
The administrator has disabled public write access.
Time to create page: 0.054 seconds
Powered by Kunena Forum