Commit graph

81 commits

Author SHA1 Message Date
zotlabs
9a5ce2354d remove some obsolete permissions stuff 2017-04-02 20:51:40 -07:00
zotlabs
af14020e42 change hook for perm_is_allowed while retaining backwards compatibility 2017-04-02 20:03:27 -07:00
redmatrix
8ba1bf02a4 document that include/permissions is being deprecated but may still be needed. 2016-08-31 20:29:32 -07:00
redmatrix
3a7d3e3a54 This checkin should make all permission modes work correctly with atokens (they should be able to post content if allowed to). It also removes the strict linkage between permissions and connections so any individual permission can be set for any xchan; even those for which you have no connections. 2016-08-01 20:12:52 -07:00
redmatrix
86eb923f29 make guest access tokens work with PERMS_NETWORK, PERMS_SITE, PERMS_PENDING, and PERMS_CONTACTS; or everything but PERMS_SPECIFIC. PERMS_SITE could be contentious, but we're currently denying them as they are a guest and don't actually have a channel on this site. We can't easily make PERMS_SPECIFIC work without providing an abook entry for the guest since we would need to set specific permissions for the guest login, but unfortunately this could be the most desirable setting to use in many cases. There is also an update of hmessages.po in this commit. 2016-07-31 18:08:41 -07:00
redmatrix
503b420292 rework perm_is_allowed 2016-07-13 20:23:20 -07:00
redmatrix
1fd65c934d lots more permission work 2016-07-13 19:53:28 -07:00
redmatrix
e6638b4715 change default so we don't have to check for array existence later 2016-07-09 21:23:00 -07:00
redmatrix
c9db8c6857 more permissions work 2016-07-09 21:08:02 -07:00
redmatrix
917a465ccd more work on perms 2016-07-09 19:03:29 -07:00
redmatrix
e6224898d2 more heavy lifting on xtensible perms 2016-07-04 21:33:25 -07:00
redmatrix
d566ffa678 more heavy lifting on extensible perms 2016-07-04 17:55:13 -07:00
redmatrix
9abd95fad3 static App 2016-03-31 16:06:03 -07:00
redmatrix
256cd6baac work on implementing account/channel move (as opposed to clone) 2016-03-09 00:46:17 -08:00
Mario Vavti
02e82e496e pimp up mod new_channel 2016-02-19 22:28:21 +01:00
redmatrix
006efbd906 change view_storage from perms_public to perms_specific in the social_private role 2016-02-03 15:44:36 -08:00
redmatrix
8847e39fb7 regression: public forums granting send stream permissions to all connections 2016-01-21 14:03:46 -08:00
redmatrix
ec00c5b18a the view_photos and post_photos permissions are redundant and are now mapped to view_storage and write_storage 2015-07-19 17:53:52 -07:00
redmatrix
be0459a98b convert the abook fields 2015-06-14 21:08:00 -07:00
redmatrix
3b859aa9ef Implement permission checking for OAuth clients using the xperm table. Currently 'all' permissions are applied to OAuth clients which gives them the same rights as the channel owner and full access to API functions as the channel owner. However, individual permissions can now be created. These mirror the permission names from the normal permission table (although it isn't required that they do so). Lack of an xp_perm entry for the specified permission and lack of an 'all' override indicates permission denied. 2015-05-17 18:14:50 -07:00
friendica
2cef6c3ac5 use PERMS_SPECIFIC for anything that hasn't been specified. This way there's nothing that's "only yourself", and let's you add additional permissions at will rather than be forced to accept the defaults or turn on custom permissions just to give a friend delegation rights or the ability to post photos. 2015-04-21 21:41:39 -07:00
Klaus Weidenbach
d0361582b0 Correcting reported Doxygen syntax warnings.
Fixed wrong Doxygen syntax and add some of the available FIXME to
Doxygen documentation.
Updated Doxygen configuration to add also all capital letter tags.
Adding some more Doxygen documentation.
2015-03-29 22:23:00 +02:00
friendica
85dd08427c change permission roles for things like channel admin to make them more easily manually settable from the connections edit page. 2015-03-20 18:50:45 -07:00
Stefan Parviainen
85e76773a0 Use grouped select field for role selection 2015-01-01 15:54:16 +01:00
friendica
ca0c310b65 change PERMS_CONTACTS to PERMS_SPECIFIC in permission roles so that individual connections can be revoked instead of this being inherited and un-changeable 2014-12-26 00:09:34 -08:00
Klaus Weidenbach
63646a1440 Some Doxygen comments and small cleanups. 2014-12-07 19:27:14 +01:00
friendica
50244f943d minor photo flag issue - and some more whitespace edits 2014-11-19 16:29:35 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
zottel
e7b634f81d set channel_w_stream to 0 for forum roles 2014-11-10 12:25:35 +01:00
friendica
583b445bc0 add "repository" permissions role and make sure we have a sane "accept" default for the custom role. 2014-10-27 16:19:30 -07:00
friendica
655c3e1b47 put privacy role selector in settings page. Change visibility of various permissions items accordingly. 2014-10-26 19:32:12 -07:00
friendica
f8468b4c3a allow custom role permissions and fix site timezone. 2014-09-29 23:36:41 -07:00
friendica
cb434818f8 closing tag 2014-09-19 16:50:43 -07:00
friendica
c6062d7872 usability tweaks 2014-09-17 21:52:30 -07:00
friendica
51d9f0d97a channel permission roles 2014-09-17 21:16:15 -07:00
friendica
eca420ec96 defined several permission roles - these will probably require some review and adjustment.
social
social_restricted
social_private
forum
forum_restricted
forum_private
feed
feed_restricted
soapbox
2014-09-17 19:46:55 -07:00
friendica
4014093572 implement permission roles - the backend should be done except for maybe a couple of small tweaks. Now we just need to define the rest of the roles and create a chooser for them. Adam started on this some time back but I don't know where that has gone. 2014-09-17 17:59:46 -07:00
friendica
d9ff121930 beginning of permission role settings 2014-08-17 22:53:00 -07:00
Jeroen
c1b89b413a Added some missing translation strings. Fixed to scalable for a few font sizes. 2014-08-14 20:02:05 +00:00
friendica
640dbdf5e9 a bit more cleanup and a bug fix or two for the new private post security model 2014-08-07 17:14:11 -07:00
friendica
b19176169c provide a specific permission for liking profiles (reuse the obsolete bookmark permission), also remove the unused 'unconnected contacts' view for now. 2014-07-17 20:54:30 -07:00
friendica
53217ad9a7 add 'block_public' checking to get_all_perms() and perm_is_allowed() so we have everything related to allowing or denying something in one place. Currently this check is done separately in a huge number of places. Now we can start to remove all the extra checks. A couple of them are still necessary, but most are now redundant. 2014-07-03 19:36:59 -07:00
Alexandre Hannud Abdo
b20887995a Implements a new permission level PERMS_PENDING
With this a user can allow some action to any user which connects
to them, even before they've connected back.

Ref.
https://mobiliza.org.br/display/478d9e71eaf55748dc646d3990651d6d34cfb7db5c38360538ec730ca3ccf908@zothub.com

Also some code cleanup and an alternative logic for handling
notifications of permission changes in zot.php.

This assumes that private posts are still restricted to people in
your addressbook. Regardless of your global permissions, a
pending channel won't get private posts, even if the post
only has a deny clause not matching the pending channel.
2014-06-19 15:13:32 -03:00
friendica
c1f8eda719 Remove automatic bookmarking - it was a bad idea and just leads to menu clutter. Bookmarks can always be saved manually if desired. 2014-04-30 17:50:06 -07:00
friendica
bf41ccbf35 'anybody in this network' permissions were not being allowed for non-connected channels. 2014-04-09 16:30:03 -07:00
friendica
24d119b8c4 introduce a new privacy level "PERMS_AUTHED" to indicate somebody that is able to successfully authenticate (but is not necessarily in this network). 2014-02-18 20:59:25 -08:00
friendica
d3120264cb more snakebite stuff 2014-02-17 18:23:01 -08:00
friendica
3665bc38ef bookmarking 2014-02-04 16:06:56 -08:00
friendica
d8f16442a1 bookmark permissions 2014-02-04 00:52:34 -08:00