Welcome, Guest
Username: Password: Remember me

TOPIC: Direct access to component

Direct access to component 03 Jan 2016 13:24 #13758

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 16
In a rather embarrassing episode, my 2-factor, super secure server with a J-Cook component installed made me squirm yesterday.

Turns out that you can access a component directly and it cuts through all the protection.

How can I set a DEFAULT VIEWING level (its not in ACL options) in a J-Cook component to make 100% sure that a GUEST (i.e not logged in) cannot access the componnent in anyway whatsoever via (i.e VIEW access)

(website)/components/mycomponent

or

(website)/index.php?option=com_mycomponent

I could program in a way of checking if signed in, but I would have thought I should be able to set this quite easily with hacking the code
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

Direct access to component 30 Jan 2016 11:22 #13791

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
EDIT : Write this in the entry file
if (!JFactory::getUser()->authorise('core.access', 'com_xxxxxx'))
{
	return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

A new ACL to create : core.access
Gonna include that. It has been asked many times.
Thank morgan, again, and sorry for beiing so long to react to that.
Coding is now a piece of cake
Last Edit: 30 Jan 2016 11:23 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: MorganL

Direct access to component 12 Apr 2016 15:46 #13909

  • krasy
  • krasy's Avatar
  • Offline
  • Premium Member
  • Posts: 90
  • Thank you received: 8
  • Karma: 5
hi,
I have similar question so I've digged that topic out,

I have many views in component they are linked with custom buttons in style:
component/componetname/name/default?filter_status=1"

In Joomla menu I use "external links",
not default component page linking
to avoid page title to be replaced by menu position name.

but
i have many views dedicated to many users groups/acls

I thought I could use Joomla "hidden menu" to assign views to ACLs
but it doesn't work...

any ideas how to secure all :)

?

Don't want to fork all,
i can make some redirections in htaccess to collect all versions of pages
to one menu posistion...

Do you know the better way?
The administrator has disabled public write access.

Direct access to component 14 Apr 2016 10:30 #13913

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Normally, every filter is instancing a menu selector.

Is it it working for state filter ?
Must check it out...
Coding is now a piece of cake
The administrator has disabled public write access.

Direct access to component 14 Apr 2016 11:10 #13914

  • krasy
  • krasy's Avatar
  • Offline
  • Premium Member
  • Posts: 90
  • Thank you received: 8
  • Karma: 5
hi Admin,
thx for replay,

there are fk filters,
bool filters are not included.

///////
Simplest problem looks like this:
-in component settings admin and user have rights to write, edit state etc i want to base on joomla acl

-we have 2 views
1 view - read only collection
2 view - editable collection with some secret data displayed

1 view is for user (acl in menu)
2 view is for admin (acl in menu)

than i have 50 other views that are not in main menu linked somewhere inside the component,
-25 for user
-25 for admin

I create hidden menu with all 50 that views and attach acls
I create htaccess that redirects

(website)/components/mycomponent/xxxxx/yyyy

and

(website)/index.php?option=com_mycomponent&view=xxxxxxxxxxxxx&layout=yyyyyyyyyyyy

to hidden menu position.

am i doing it right?
The administrator has disabled public write access.

Direct access to component 10 May 2016 20:18 #13947

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Sorry for late answer.
You can effectively do that, but if you want a better security, add some ACL by yoursefl at the very critical points.

I am gonna dig in more profundly because users have asked such thing. Limiting the access of the VIEW page by ACL (normally, we think in term of datas access.)

By the way. The boolean filter is now available in the last version:
www.j-cook.pro/index.php/docs/versions/215-2-8-2
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: krasy

Direct access to component 11 May 2016 08:09 #13948

  • krasy
  • krasy's Avatar
  • Offline
  • Premium Member
  • Posts: 90
  • Thank you received: 8
  • Karma: 5
I ve been doing some approaches with differing view and edit access
for many user groups or acls but by the end of day
separate collections, separate flys and separate forms linked properly with each other,
were simplest and most effective solution.

Limiting the access in builder would require adding id or name of group or ACL that is in other instance of Joomla,
no idea how to solve that easier...? Or in config on joomlas backed?

Second issue what was necessary and universal,
was to connect viewing records ACL with authors groups
for example if user is in group A,
and saves the record all users for group A have also access to that record,
but
when user is is many groups there was a problem,
should we define actual context...?

but when trying to allow users to edit only owns groups records
and have other records view only made
mess like hell
:D

Thinking about data access
you mean adding ACLs to columns in table?
hmmm that would simplyfy a lot...


PS thx for filters in menu items!
The administrator has disabled public write access.

Direct access to component 11 May 2016 10:37 #13952

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
The thing with Jooma is that you can do that easily.
I mean, you can filter by ACL literraly what you want.

First, define new ACL aliases in access.xml.
Then, insert the code for limiting access to a layout, or to view a particular column.
Finaly, map your groups to those ACLs

A second way, totaly different, is to apply an access to the records, using the 'viewaccess' feature. (using viewlevels).
Choose the Access wizard for every table you are using.
Defined some custom accessleves in the joomla core.
Associate the rows with the accesslevel you want.
That way, the layouts stays availables, but not the datas.

Joomla is quite exhaustive (compared to WP) in that way.
It depends what is your plan.
If you need more help, just tell me in private what is the map of the restrictions you want, I am hirable for such particular cases.
Coding is now a piece of cake
The administrator has disabled public write access.

Direct access to component 11 May 2016 11:30 #13956

  • polsl
  • polsl's Avatar
  • Offline
  • New Member
  • Posts: 8
  • Karma: 0
for now we have managed to make everything more or less to work,
but in the near future there is a high possibility of code refactoring,
now we have to sell some solutions to continue the work,
we will let you know it that happens.
thx for offering help.
The administrator has disabled public write access.

Direct access to component 11 May 2016 18:44 #13960

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
You are welcome.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.149 seconds

Get Started